<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.List"%>
<%@page import="com.wanmait.cookBook.vo.Topic"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.wanmait.cookBook.vo.Userinfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path =request.getContextPath();%>
<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心 - 下厨房</title>
<link rel="shortcut icon" href="https://static.meishichina.com/v6/img/lib/f.ico"/>
<link rel="apple-touch-icon" href="https://static.meishichina.com/v6/img/lib/wapico.png" />
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/lib/all.css?v1=13">
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/app/center/all.css?v1=2017-08-17">
    <link rel="stylesheet" type="text/css"
          href="https://static.meishichina.com/v6/css/app/center/center_home.css?v1=2018-09-21">
</head>
<body>
<jsp:include page="/front/head.jsp"></jsp:include>
<%Userinfo loginuser=(Userinfo)session.getAttribute("loginuser"); %>
<%if(null==loginuser) response.sendRedirect(request.getContextPath()+"/front/login.jsp"); %>
<!-- 主框架 -->
<div class="w_main clear">

    <div class="mod_left">
        <div class="menu_wrap">
<ul>
<li>
<a class=on href="<%=path%>/front/personal.jsp">用户<br>中心</a>
</li>
<li>
<a  href="<%=path%>/CookServlet">个人<br>菜谱</a>
</li>

<li>
<a   href="<%=path%>/front/upDiary.jsp">日志</a>
</li>
<li>
<a  href="<%=path%>/getAllTasteServlet">发布<br>作品</a>
</li>
<li>
<a  href="<%=path%>/front/publishTopic.jsp">发布<br>话题</a>
</li>
<li>
<a  href="<%=path%>/front/set.jsp">账户<br>设置</a>
</li>
</ul>
</div>

    </div>
    <!-- 右侧 -->
    <div class="mod_right" style="margin-top:0;padding-top:0;">
        <div class="space_info clear" style="float:left;width:700px; margin-left:50px;">
			<!-- 用户头像 -->
            <div class="pic">
                <a href="javascript:void(0)"><img
                        class="imgLoad" src="<%=path %>/front/userImages/<%=loginuser.getUserFace() %>"
                         width="150" height="150"></a>
            </div>
            
            <div class="detail">

                <em><a href="javascript:void(0)" target="_blank"><%=loginuser.getUserName() %>  ིྀིྀ</a></em>

                
                <ul class="substatus">

                    <li>
                        <a title="关注" href="jacascript:void(0)">
                            <b><%=session.getAttribute("focusCount") %></b><br>
                            关注
                        </a></li>
                    <li>
                        <a title="粉丝" href="jacascript:void(0)">
                            <b><%=session.getAttribute("fansCount") %></b><br>
                            粉丝
                        </a></li>
                    <li>
                        <a title="获赞数" href="jacascript:void(0)">
                            <b><%=session.getAttribute("likeCount") %></b><br>
                           获赞数
                        </a></li>
                         <li>
                        <a title="个性签名" href="jacascript:void(0)">
                            <b></b><br>
                            <%=loginuser.getWords() %>
                        </a></li>    
                </ul>


                <div class="subtools">
                    <a href="jacascript:void(0)">通知
                                            </a>
                    <a href="jacascript:void(0)">私信
                                            </a>
       
                </div >
     <!-- -------------------------个人中心 ------------------------------------------- -->
<div style="width:800px;height:400px;margin-left:-170px; padding:0;margin-top:25px;">
	<a style="font-size:16px;text-decoration:none;color:red;" href="javascript:void(0);" class=on id="publish">我发布的话题</a>&nbsp;&nbsp;&nbsp;
	<a style="font-size:16px;text-decoration:none;" href="javascript:void(0);" class="waitCheck" >话题待审核</a>&nbsp;&nbsp;&nbsp;
	<a style="font-size:16px;text-decoration:none;" href="javascript:void(0);" class="backBox" >话题退稿箱</a>&nbsp;&nbsp;&nbsp;
	<hr>
<!-- ---------------------------------个人中心 ---------------------------------------- -->		
<div class="showTopic">
		<!-- 按时间排序 -->
	<div id="search" style="margin-top:20px;margin-bottom:10px;margin-left:20px;">
		<!-- 选择条件 -->
		<!-- 改下拉列表框选中的值 -->
		<script type="text/javascript">
			$(function(){
				//servlet转发的值
				$("#t<%=request.getAttribute("time")%>").prop("selected",true);
				$("#or<%=request.getAttribute("or")%>").prop("checked",true);
			});
		</script>
		<form method="post" action="<%=path%>/PersonalServlet">
			<select id="time" name="time">
				<option id="t7" value="7">近一周</option>
				<option id="t30" value="30">近一月</option>
				<option id="t365" value="365">近一年</option>
				<option id="t0" value="0">全部</option>
			</select>
			<input id="or0" name="or" type="radio" value="0">升序
			<input id="or1" name="or" checked type="radio" value="1">降序
			<input type="submit" value="查询">
		</form>
	</div>
	<!----------------------显示 --------------------------->
	<%List<Topic> allTopic = (ArrayList<Topic>)request.getAttribute("allTopic");%>
	<%for(Topic topic:allTopic){%>
	<div style="width:800px;overflow:hidden;height:200px;background-color:#F0F0F0;margin-top:20px;">
			<div style="float:left;">
				<a href=""><img src="<%=path %>/front/userImages/<%=topic.getUserinfo().getUserFace() %>" style="width:42px;height:42px;border-radius:21px;margin-top:10px"></a>
			</div>
			<div style="float:left; margin-left:30px;margin-top:10px;width:500px;">
				<span><a href="" style="font-size:16px;"><%=topic.getUserinfo().getUserName()%></a></span><br>
				<span style="font-weight:500">
				<% SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");String time = format.format(topic.getPublishTime());%> 
            <%=time %></span><br>
				<span style="margin-top:5px;display:block;" ><a href="" style="font-size:14px; font-weight:500"><%=topic.getContext() %></a></span><br>
				<a style="margin-top:-10px;display:block;" href=""><img src="<%=path %>/front/topicImages/<%=topic.getTopicImage() %>" style="width:100px;height:100px;"></a><br>
			</div>
 			<div style="float:left;margin-left:0px;margin-top:75px;">
 					<a class="publishRemove" topicId="<%=topic.getId() %>" style=" display:block; border:1px solid #000;width:80px; height:30px;border-radius:5px;text-align:center;line-height:30px;" href="javascript:void(0);">移除</a>
 			</div>
 		</div>
	<%} %>	
</div>
</div>
<!-- -------------------------个人中心 ------------------------------------------- -->
      </div>
 </div>
 <!-- ------------------我的发布移除加事件------------------------- -->
 <script type="text/javascript">
	function removeByTopicId(){
			var topicId = $(this).attr("topicId");
			$(this).parent().parent().remove();
			$.ajax({
				url:"<%=path%>/PersonalServlet",
				type:"get",
				data:{action:"removeByTopicId",topicId:topicId},
				async:false,
				success:function(mes){
				}
			});
		}
 	$(function(){
 		$(".publishRemove").click(removeByTopicId);
 	});
 </script>
 <!-- ----------------------我发布的话题加点击事件----------------------------- -->
<script type="text/javascript">
	$(function(){
		$("#publish").click(function(){
			$(".waitCheck").css("color","#000");
			$(".backBox").css("color","#000");
			$("#publish").css("color","red");
			window.parent.location.href=window.parent.location.href;
		});
	});
</script>
<!-- --------------------待审核加事件-------------------- -->
<script type="text/javascript">
	$(function(){
		$(".waitCheck").click(function(){
			$(".waitCheck").css("color","red");
			$(".backBox").css("color","#000");
			$("#publish").css("color","#000");
			$.ajax({
 				url:"<%=path%>/PersonalServlet",
 				type:"get",
 				data:{action:"showWaitCheckTopic"},
 				async:false,
 				success:function(mes){
 					$(".showTopic").html(mes);
 				}
 			});
		});
	});
</script>
<!-- ------------------------待审核移除加事件------------------------ -->
<script type="text/javascript">
	$(function(){
		$(".showTopic").on("click",".publishRemove",removeByTopicId);
	});
</script>
               <!-- 人气美食家  按点赞数排出来用户 -->
        <div class="home_right mt30" style="float:left;margin-top:150px;margin-left:200px;">

            <div class="ui_title mt20">
                <div class="ui_title_wrap">
                    <h3>人气美食家TOP榜</h3>
                </div>
            </div>

            <div class="ui_list_2_48 clear">
            <%ArrayList<Userinfo> topUser=(ArrayList<Userinfo>)session.getAttribute("topUser"); %>
                <ul>
                <% for(Userinfo topUserinfo:topUser){%>
               
                                        <li>
                        <a href="javascript:void(0)" 
                           title=""><img src="<%=path %>/front/userImages/<%=topUserinfo.getUserFace()%>" class="imgLoad" width="48"
                                                             height="48"><%=topUserinfo.getUserName()%></a>
                    </li>
                    <% }%> 
                                        <li>
                        <a href="javascript:void(0)"
                           title="美拉拉的美食日记"><img src="https://i5.meishichina.com/data/avatar/011/56/79/44_avatar_big.jpg?x-oss-process=style/c180&v=20200817" class="imgLoad" width="48"
                                                             height="48">美拉拉的美食日记</a>
                    </li>
                    <li>
                        <a href="javascript:void(0)"
                           title="南瓜大姐姐"><img src="https://i5.meishichina.com/data/avatar/012/00/79/91_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">南瓜大姐姐</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="食无涯"><img src="https://i5.meishichina.com/data/avatar/009/55/48/99_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">食无涯</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="朱朱_oysy"><img src="https://i5.meishichina.com/data/avatar/011/04/97/19_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">朱朱_oysy</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="爱在夏郢"><img src="https://i5.meishichina.com/data/avatar/011/34/36/33_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">爱在夏郢</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="不做妖精好多年"><img src="https://i5.meishichina.com/data/avatar/001/80/65/50_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">不做妖精好多年</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="寻梦一ZbDu"><img src="https://i5.meishichina.com/data/avatar/010/88/62/47_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">寻梦一ZbDu</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="冷水浮萍"><img src="https://i5.meishichina.com/data/avatar/001/82/23/95_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">冷水浮萍</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="小洞天"><img src="https://i5.meishichina.com/data/avatar/000/12/61/19_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">小洞天</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="小鹿🎀老师"><img src="https://i5.meishichina.com/data/avatar/012/54/45/85_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">小鹿🎀老师</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="少年狂_KPWo"><img src="https://i5.meishichina.com/data/avatar/012/51/49/08_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">少年狂_KPWo</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="Meggy跳舞的苹果"><img src="https://i5.meishichina.com/data/avatar/007/51/35/84_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">Meggy跳舞的苹果</a>
                    </li>
                                        <li>
                        <a href="javascript:void(0)"
                           title="晓雪爱厨房"><img src="https://i5.meishichina.com/data/avatar/006/27/48/66_avatar_big.jpg?x-oss-process=style/c180&v=20200819" class="imgLoad" width="48"
                                                             height="48">晓雪爱厨房</a>
                    </li>
                                    </ul>    
                                    </ul>
            </div>
        </div>
       
    </div><!-- 右侧结束 -->
</div>
<!-- ************************************************** -->
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/all.js?v1=20180922"></script>
<script type="text/javascript">
msc.user.init();
$("img.imgLoad").imgLoad();
</script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/get_num.js?v=20191022"></script>
<script type="text/javascript">
$(".get_num li").get_num('recipe');

$("#J_list").on("click", "a.del", function() {
					var that = this;
						if (that.innerHTML !== '移除中') {
							that.innerHTML = '移除中';
							msc.user.set_cancel_fav_recipe(that.getAttribute("data-id"), function() {
								msc.ui.dialog.success("操作成功");
								
								if($("#J_list").find("li").length < 2){
		                            return setTimeout(function(){
		                                location.reload(true);
		                            }, 500);
		                        } else {
		                            $(that).closest("li").slideUp(200, function(){
		                                $(this).remove();
		                            });
		                        }
								
							}, function(){
								that.innerHTML = '移除';
							});
						}
						return false;
					});
</script>

<script>
$("li.top_bar_more").hoverDelay(function(){$("li.top_bar_more div").show()},function(){$("li.top_bar_more div").hide()},200,200);var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="//hm.baidu.com/hm.js?fb9cd9dcdda23cee0c7357db9be24acb";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s)})();
</script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/all.js?v1=20180922"></script>
<script type="text/javascript">
msc.user.init();
$("img.imgLoad").imgLoad();
</script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/msc-tools-date.js"></script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/app/center/feed.js?v1=2017-06-06"></script>
<script type="text/javascript">

    $("#search").click(function () {
        var q = $("#q").val().replace(/\s+/g, "").replace("　", "");
        window.location.href = '//home.meishichina.com/search/' + (q == "" ? '' : q + '/')
    });
    $("#q").keydown(function (e) {
        if (e.keyCode == 13) $("#search").click()
    });

    var feed = msc.tools.feed;
    feed.init({
        dom: {
            list: $("#J_feed_list")
        },
        data: {
            type: 'uid',
            classid: '',
            pageSize: 15,
            page: 1
        },
        render: function (html, data) {
            return '<li>' + html + '</li>';
        },
        success: function () {
            $("#J_feed_list li").each(function () {
                if ($(this).find('.detail p').html() == '') {
                    $(this).hide().remove()
                }
            });
        }
    });

    $("#J_feed_nav a").click(function () {


        if ($(this).hasClass('on') || $("#J_feed_load a").hasClass('on'))
            return false;

        feed.config.data.type = $(this).attr("data-type");
        if ($(this).attr("data-type") == 'uid')
            feed.config.data.uid = $(this).attr("data-uid");

        feed.reload();
        $(this).addClass("on").siblings().removeClass("on");
        return false;
    });


</script>

<script>

</script>
</body>
</html>

